package IOC.C1_beans.C1_3_beansDefinition.C1_3_2_beansFactoryClass;

import IOC.C1_beans.C1_3_beansDefinition.C1_3_2_beansFactoryClass.service.AccountService;
import IOC.C1_beans.C1_3_beansDefinition.C1_3_2_beansFactoryClass.service.ClientService;
import IOC.C1_beans.C1_3_beansDefinition.C1_3_2_beansFactoryClass.service.Service;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Desc:&emsp;&ensp;
 *
 * @author 李渊&emsp;liyuan7@yusys.com.cn
 * @version 1.0
 * @since V4.3&emsp;2022/6/2
 */
public class Root {

    public static void main(String[] args) {
        // create and configure beans
        ApplicationContext context = new ClassPathXmlApplicationContext("IOC/C1_beans/C1_3_beansDefinition/C1_3_2_beansFactoryClass/beans.xml");
        ClientService clientService = context.getBean("clientService", ClientService.class);
        AccountService accountService = context.getBean("accountService", AccountService.class);
        Service service = context.getBean("service", Service.class);
        System.out.println(clientService);
        System.out.println(accountService);
        System.out.println(service);
        System.out.println(context.getType("service"));
    }
}
